fix: Log error message if malformed JSON file found#7638
Merged
camdecoster merged 4 commits intomasterfrom Nov 17, 2025
Merged
Conversation
emilykl
reviewed
Nov 14, 2025
devtools/dashboard_utilities.mjs
Outdated
| keywords: types.join(', ') | ||
| }; | ||
| } catch { | ||
| console.log(`Couldn't parse ${file.name} as JSON. Excluding from mocks list.`); |
Contributor
There was a problem hiding this comment.
@camdecoster Could we still surface the stack trace here, in case the code inside try fails in an unexpected way due to something other than the call to JSON.parse()?
Either that, or put only the JSON.parse() call inside the try.
Contributor
Author
There was a problem hiding this comment.
I added more specific error handling.
emilykl
approved these changes
Nov 15, 2025
Contributor
emilykl
left a comment
There was a problem hiding this comment.
One comment but not a blocker, otherwise LGTM
This reverts commit ac6af51.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add logic to catch errors when mocks are loaded in plotly.js DevTools and log a message.
Closes #7637.
Changes
Testing
npm startnpm start